# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-tomli
pkgver=2.0.1
pkgrel=4
pkgdesc="Lil' TOML parser"
url="https://github.com/hukkin/tomli"
license="MIT"
arch="noarch"
depends="python3"
makedepends="py3-installer"
subpackages="$pkgname-pyc"
source="https://github.com/hukkin/tomli/archive/$pkgver/tomli-$pkgver.tar.gz
	https://files.pythonhosted.org/packages/py3/t/tomli/tomli-$pkgver-py3-none-any.whl
	"
builddir="$srcdir/tomli-$pkgver"

build() {
	# both py3-pep517 and py3-flit need tomli, so we need to fetch the wheel
	# directly from PyPI to avoid a circular dependency
	return 0
}

check() {
	# use tests from GitHub tarball, but source code from wheel
	unzip -q "$srcdir"/tomli-$pkgver-py3-none-any.whl -d "$srcdir"/wheel
	PYTHONPATH="$srcdir/wheel" python3 -m unittest
}

package() {
	python3 -m installer -d "$pkgdir" "$srcdir"/tomli-$pkgver-py3-none-any.whl
}

sha512sums="
a467f8d48cdbd7213bd9b6f85fd48ba142ab7c9656c40bb30785e1c4b37a9e29eaed420f183458ad20112baee8413ebbec87755332795c8f02235d1018c3aa5c  tomli-2.0.1.tar.gz
b6164b03d3db360093f92e644e87a37a0ce20d63d7e9e271fcafd727f4fdb73ad6b301aaf32b3d2839f6eedbc8ea499dafba7335b8fdfc4667e30ed50c9805b4  tomli-2.0.1-py3-none-any.whl
"
